import java.util.List;

import it.lupo.model.BarCode;
import it.lupo.model.service.BarCodeService;
import it.lupo.model.service.SearchService;


public class testbarcode {

	public static void main(String[] args) {
		BarCodeService service = BarCodeService.getInstance();
		BarCode res = service.check("123456");
		System.out.println(res);
		
		System.out.println("SEARCH 0");
		SearchService sservice = SearchService.getInstance();
		List<BarCode> list = sservice.search(null, null, "milan", null, null,null);
		for(BarCode b : list)
		{
			System.out.println("RES > "+b);
		}
		
		System.out.println("SEARCH 1");
		list = sservice.search(null, null, "bergamo", null, null,null);
		for(BarCode b : list)
		{
			System.out.println("RES > "+b);
		}
		
		System.out.println("SEARCH 2");
		list = sservice.search(null, null, "bergamo", null, "maur",null);
		for(BarCode b : list)
		{
			System.out.println("RES > "+b);
		}
		
		
		
		System.out.println("SEARCH 3");
		list = BarCodeService.getInstance().getLasts(2);
		for(BarCode b : list)
		{
			System.out.println("RES > "+b);
		}
		
	}
}
